/*
 * Copyright © 2019 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

@import "../../styles/variables.less";
@import '../dag-plus/color-constants.less';

@minimap-width: 250px;
@minimap-height: 150px;
@minimap-padding: 5px;
@minimap-border-size: 2px;

.dag-minimap {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: ~"calc(@{minimap-width} + @{minimap-padding} * 2 + @{minimap-border-size} * 2)";
  height: ~"calc(@{minimap-height} + @{minimap-padding} * 2 + @{minimap-border-size} * 2)";
  border: @minimap-border-size solid @grey-03;
  border-radius: 4px;
  background-color: @grey-06;
  padding: @minimap-padding;
  overflow: hidden;
  box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.4);
  z-index: 10;

  .nodes-container {
    position: relative;
    height: 100%;
    width: 100%;
  }

  .node {
    position: absolute;
    background-color: @transform-plugins-color;
    border: 1px solid @grey-02;

    &.realtimesource,
    &.streamingsource,
    &.batchsource {
      background-color: @source-plugins-color;
    }

    &.realtimesink,
    &.batchsink,
    &.sparksink {
      background-color: @sink-plugins-color;
    }

    &.transform {
      background-color: @transform-plugins-color;
    }

    &.errortransform {
      background-color: @error-transform;
    }

    &.alertpublisher {
      background-color: @alertpublisher-plugins-color;
    }

    &.action {
      background-color: @action-plugins-color;
    }

    &.sparkprogram {
      background-color: @spark-plugins-color;
    }

    &.condition {
      background-color: @condition-plugin-color;
    }
  }

  .viewport-container {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
  }

  .viewport-box {
    position: absolute;
    background-color: rgba(88, 183, 246, 0.3);
    border: 2px solid @brand-primary;
  }
}
